<?php

class ProfileModel extends Model {

    function getFilename($filename) {
        $pos = strripos($filename, '.');
        if ($pos === false) {
            return $filename;
        } else {
            return substr($filename, 0, $pos);
        }
    }

    function getExtension($filename) {
        $pos = strripos($filename, '.');
        if ($pos === false) {
            return "";
        } else {
            return substr($filename,$pos);
        }
    }

    function insertpost($field){
        //do the query
        $insert_string = "'".$field['idwall']."','".$field['id_writer']."','".$field['isi']."'";
        $this->query('insert into post_wall (Idwall,Id_writer,Isi) values ('.$insert_string.')');
    }

    function insertkomen($field){
        //do the query
        $insert_string = "'".$field['idpost']."','".$field['id_writer']."','".$field['isi']."'";
        $this->query('insert into komen_wall (Idpost,Id_writer,Isi) values ('.$insert_string.')');
    }

}
